<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <script>

        var name = '   itbaizhan   ';
        console.log(name.trim()) //itbaizhan

        console.log(name.trimEnd())
        console.log(name.trimStart())

    </script>


</body>
</html>